package com.api.tournament.dao;

import com.api.core.ApiMapper;
import com.api.tournament.model.StageRank;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface StageRankMapper extends ApiMapper<StageRank> {
    StageRank findByStageIdAndUserId(Long stageId, Long tournamentUserId);

    void deleteByStageId(Long stageId);

    Integer lastLose(Long stageId, Long tournamentUserId);

    Integer maxLose(Long stageId, Long tournamentUserId);

    /**
     * 获取阶段所有分组
     * @param stageId
     * @return
     */
    List<String> groupName(Long stageId);

    List<StageRank> promotion(Integer promotionSize, Long stageId, String groupName);

    List<StageRank> selectByGroupOrderWin(String groupName, Long stageId);
}